package com.fenghongzhang.module_home.adapter

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.fragment.app.ListFragment
import androidx.viewpager2.adapter.FragmentStateAdapter
import com.fenghongzhang.module_home.ui.hot.HotFragment
import com.fenghongzhang.module_home.ui.movie.MovieFragment
import com.fenghongzhang.module_home.ui.recommend.movie.RecommendFragment

// 新增 HomePagerAdapter 类
class HomePagerAdapter(fragmentActivity: FragmentActivity,val fragments: List<Fragment>) : FragmentStateAdapter(fragmentActivity) {

    override fun getItemCount(): Int {
        return fragments.size // 假设有3个Tab
    }

    override fun createFragment(position: Int): Fragment {
        return fragments.get(position)
    }
}
